﻿@model IEnumerable<JT.WEB.Areas.Identity.Data.JTWEB3User>
@{
    ViewData["Title"] = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h1>用户管理</h1>
<a asp-action="Create" class=" btn btn-outline-success">添加用户</a>

<p> </p>
@*<form asp-action="Index" method="get">
        <div class="form-actions no-color">
            <div class="form-row ">


                <div class="col-sm-4 input-group">
                    <input type="text" name="SearchString" value="@ViewData["currentFilter"]" class="form-control" />

                    <input type="submit" value="搜索" class="btn  btn-primary" />
                </div>

            </div>
        </div>
    </form>*@

<table class="table">
    <thead>
        <tr>
            <th>
                <a asp-action="Index" asp-route-sortOrder="@ViewData["IdSortParm"]">Id</a>
            </th>
            <th>
                <a asp-action="Index" asp-route-sortOrder="@ViewData["NameSortParm"]">用户名</a>
            </th>
            @*<th>
                    <a asp-action="Index" asp-route-sortOrder="@ViewData["NameSortParm"]"> 创建日期</a>
                </th>*@
            <th>
                <a asp-action="Index" asp-route-sortOrder="@ViewData["NameSortParm"]"> 明细</a>
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Id)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.UserName)
                </td>

                @*<td>
                        @Html.DisplayFor(modelItem => item.IsRuKu)
                    </td>*@

                <td>
                    @*<a asp-action="Edit" asp-route-id="@item.Id">编辑</a> |
                        <a asp-action="Details" asp-route-id="@item.Id">详细</a> |
                        <a asp-action="Delete" asp-route-id="@item.Id" class="text-danger">删除</a>*@
                    <form asp-action="Delete" asp-route-data="@item" method="post">

                        @*// <input type="text" asp-for="@item.Id" class="form-control"  />*@
                        @*<input type="submit"  value="删除" class="btn btn-danger"/>*@
                        <button type="submit" class="btn btn-danger" onclick="return confirm('确认删除?')">删除 </button>
                        <span asp-validation-for="@item"></span>
                    </form>


                </td>
                <td> |  <a asp-action="Edit" asp-route-userId="@item.Id"> 修改</a></td>
            </tr>
        }
    </tbody>
</table>
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
@*@{
        var prevDisabled = !Model.HasPreviousPage ? "disabled" : "";
        var nextDisabled = !Model.HasNextPage ? "disabled" : "";
    }

    <a asp-action="Index"
       asp-route-sortOrder="@ViewData["CurrentSort"]"
       asp-route-pageNumber="@(Model.PageIndex - 1)"
       asp-route-currentFilter="@ViewData["CurrentFilter"]"
       class="btn btn-default @prevDisabled">
        上一页
    </a>
    <a asp-action="Index"
       asp-route-sortOrder="@ViewData["CurrentSort"]"
       asp-route-pageNumber="@(Model.PageIndex + 1)"
       asp-route-currentFilter="@ViewData["CurrentFilter"]"
       class="btn btn-default @nextDisabled">
        下一页
    </a>*@
